package com.v5ba.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class ApiController {
    @GetMapping("set")
    public String set(HttpServletRequest request){
        request.getSession().setAttribute("name", "神坑");
        return "ok";
    }
    @GetMapping("get")
    public String get(HttpServletRequest request){
        return (String)request.getSession().getAttribute("name");
    }
}
